package com.mew.chess.core.game.bjl.game.message;

import com.mew.chess.core.game.bjl.game.common.BjlConstantValue;
import com.mew.common.entity.user.User;
import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.*;

import java.util.Collection;
import java.util.List;

/**
 * @author dylin
 * @create 2021/4/25
 */
@Data
@ToString
public class PushShuffleCardMessage extends ZebraBaseMessage<PushShuffleCardMessage> {
    private final int remainTime = BjlConstantValue.SHUFFLE_TIME;

    private long ino;//局号
    private int cardNumber;//牌数
    private Collection<UserMessage> bigPlay;//大玩家列表

    @Override
    public void write(ByteBuf b) {

        writeInt(b,remainTime);
        writeLong(b,ino);
        writeInt(b,cardNumber);
        writeInt(b,bigPlay.size());
        for (UserMessage userMessage : bigPlay) {
            userMessage.write(b);
        }
    }

    @Override
    public PushShuffleCardMessage read(ByteBuf byteBuf) {
        return null;
    }
}
